package com.dongdongsongcan.app.view;

import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.Color;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.dongdongsongcan.app.R;
import com.dongdongsongcan.app.control.bean.OrderStatusData;
import com.su.dolphin.utils.ViewUtil;

public class OrderStatusFoodItem extends BaseViewItem<OrderStatusData.Food> {

	private final ImageView os_food_item_icon;
	private final TextView os_food_item_des;
	private final TextView os_food_item_name;
	private TextView mAddressitem_user;
	private TextView mAddressitem_address;
	private TextView os_food_item_status;

	public OrderStatusFoodItem(Context context) {
		mContainer = ViewUtil.inflateView(
				R.layout.layout_orderstatus_food_item, context);
		os_food_item_name = (TextView) mContainer
				.findViewById(R.id.os_food_item_name);
		os_food_item_des = (TextView) mContainer
				.findViewById(R.id.os_food_item_des);
		os_food_item_icon = (ImageView) mContainer
				.findViewById(R.id.os_food_item_icon);
		os_food_item_status = (TextView) mContainer
				.findViewById(R.id.os_food_item_status);

	}

	public void setInfo(OrderStatusData.Food food) {
		if (food == null) {
			return;
		}
		os_food_item_name.setText(food.getMenu_name());
		os_food_item_des.setText(food.getNum() + "份");
		if (food.getStatus() == 0) {
			os_food_item_status.setText("未制作");
			os_food_item_status.setTextColor(Color.GRAY);
		} else {
			os_food_item_status.setText("制作完成");
			os_food_item_status.setTextColor(Color.RED);

		}
	}
}
